# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=silk
pkgver=3.24.0
pkgrel=1
groups=('blackarch' 'blackarch-networking' 'blackarch-scanner')
pkgdesc='A collection of traffic analysis tools developed by the CERT NetSA to facilitate security analysis of large networks.'
arch=('x86_64' 'aarch64')
url='https://tools.netsa.cert.org/silk/download.html'
license=('GPL-2.0-only')
depends=('python' 'libfixbuf' 'lzo' 'libpcap' 'gnutls' 'c-ares' 'adns' 'snappy')
source=("https://tools.netsa.cert.org/releases/$pkgname-$pkgver.tar.gz")
sha512sums=('d316bf1af2c8164e0d917fc6b51ae92aa17c49c9ee05b24a98b2ff2de2178bac6a91eb7b2840e3518666e87097138a3568e8dd516c6a8b8f49290c833fa9db81')

build() {
  cd "$pkgname-$pkgver"

  export LIBS="-lpthread"

  ./configure --prefix=/usr --enable-ipv6 --sbindir=/usr/bin --with-gnutls \
    --with-pic --with-pcap -with-libfixbuf --enable-output-compression \
    --enable-localtime --enable-data-rootdir="/usr/share/$pkgname"

  make
}

package() {
  cd "$pkgname-$pkgver"

  install -Dm 644 LICENSE.txt "$pkgdir/usr/share/licenses/$pkgname/LICENSE"

  rm -f doc/{Makefile*,GPL.txt}

  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" doc/*

  make DESTDIR="$pkgdir" install
}

